#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Maxn=1e5+5;
int n,Q;
int a[Maxn];

int main(){
    freopen("pockets.in","r",stdin);
    freopen("pockets.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<n;i++) scanf("%d",&a[i]);

    while(Q--){
        int x;
        scanf("%d",&x);
        a[n]=x;
        cout<<a[1]+max(a[3],a[4])-(a[2]+a[3]+a[4]-max(a[3],a[4]))<<endl;
    }

    // system("pause");
    return 0;
}